<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Scroll Snapping Change Proposal</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="exploring" name="csswg-work-status">
  <meta content="UD" name="w3c-status">
  <meta content="A brief description of an alternate model for scroll-snapping." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
  <link href="https://www.w3.org/StyleSheets/TR/2016/W3C-UD" rel="stylesheet" type="text/css">
  <meta content="Bikeshed 1.0.0" name="generator">
<style>/* style-md-lists */

            /* This is a weird hack for me not yet following the commonmark spec
               regarding paragraph and lists. */
            [data-md] > :first-child {
                margin-top: 0;
            }
            [data-md] > :last-child {
                margin-bottom: 0;
            }</style>
<style>/* style-selflinks */

            .heading, .issue, .note, .example, li, dt {
                position: relative;
            }
            a.self-link {
                position: absolute;
                top: 0;
                left: calc(-1 * (3.5rem - 26px));
                width: calc(3.5rem - 26px);
                height: 2em;
                text-align: center;
                border: none;
                transition: opacity .2s;
                opacity: .5;
            }
            a.self-link:hover {
                opacity: 1;
            }
            .heading > a.self-link {
                font-size: 83%;
            }
            li > a.self-link {
                left: calc(-1 * (3.5rem - 26px) - 2em);
            }
            dfn > a.self-link {
                top: auto;
                left: auto;
                opacity: 0;
                width: 1.5em;
                height: 1.5em;
                background: gray;
                color: white;
                font-style: normal;
                transition: opacity .2s, background-color .2s, color .2s;
            }
            dfn:hover > a.self-link {
                opacity: 1;
            }
            dfn > a.self-link:hover {
                color: black;
            }

            a.self-link::before            { content: "¶"; }
            .heading > a.self-link::before { content: "§"; }
            dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

            body {
                counter-reset: example figure issue;
            }
            .issue {
                counter-increment: issue;
            }
            .issue:not(.no-marker)::before {
                content: "Issue " counter(issue);
            }

            .example {
                counter-increment: example;
            }
            .example:not(.no-marker)::before {
                content: "Example " counter(example);
            }
            .invalid.example:not(.no-marker)::before,
            .illegal.example:not(.no-marker)::before {
                content: "Invalid Example" counter(example);
            }

            figure {
                counter-increment: figure;
            }
            figcaption:not(.no-marker)::before {
                content: "Figure " counter(figure);
            }</style>
<style>/* style-autolinks */

            .css.css, .property.property, .descriptor.descriptor {
                color: #005a9c;
                font-size: inherit;
                font-family: inherit;
            }
            .css::before, .property::before, .descriptor::before {
                content: "‘";
            }
            .css::after, .property::after, .descriptor::after {
                content: "’";
            }
            .property, .descriptor {
                /* Don't wrap property and descriptor names */
                white-space: nowrap;
            }
            .type { /* CSS value <type> */
                font-style: italic;
            }
            pre .property::before, pre .property::after {
                content: "";
            }
            [data-link-type="property"]::before,
            [data-link-type="propdesc"]::before,
            [data-link-type="descriptor"]::before,
            [data-link-type="value"]::before,
            [data-link-type="function"]::before,
            [data-link-type="at-rule"]::before,
            [data-link-type="selector"]::before,
            [data-link-type="maybe"]::before {
                content: "‘";
            }
            [data-link-type="property"]::after,
            [data-link-type="propdesc"]::after,
            [data-link-type="descriptor"]::after,
            [data-link-type="value"]::after,
            [data-link-type="function"]::after,
            [data-link-type="at-rule"]::after,
            [data-link-type="selector"]::after,
            [data-link-type="maybe"]::after {
                content: "’";
            }

            [data-link-type].production::before,
            [data-link-type].production::after,
            .prod [data-link-type]::before,
            .prod [data-link-type]::after {
                content: "";
            }

            [data-link-type=element],
            [data-link-type=element-attr] {
                font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
                font-size: .9em;
            }
            [data-link-type=element]::before { content: "<" }
            [data-link-type=element]::after  { content: ">" }

            [data-link-type=biblio] {
                white-space: pre;
            }</style>
<style>/* style-dfn-panel */

        .dfn-panel {
            position: absolute;
            z-index: 35;
            height: auto;
            width: -webkit-fit-content;
            width: fit-content;
            max-width: 300px;
            max-height: 500px;
            overflow: auto;
            padding: 0.5em 0.75em;
            font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
            background: #DDDDDD;
            color: black;
            border: outset 0.2em;
        }
        .dfn-panel:not(.on) { display: none; }
        .dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
        .dfn-panel > b { display: block; }
        .dfn-panel a { color: black; }
        .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
        .dfn-panel > b + b { margin-top: 0.25em; }
        .dfn-panel ul { padding: 0; }
        .dfn-panel li { list-style: inside; }
        .dfn-panel.activated {
            display: inline-block;
            position: fixed;
            left: .5em;
            bottom: 2em;
            margin: 0 auto;
            max-width: calc(100vw - 1.5em - .4em - .5em);
            max-height: 30vh;
        }

        .dfn-paneled { cursor: pointer; }
        </style>
<style>/* style-syntax-highlighting */

        .highlight:not(.idl) { background: hsl(24, 20%, 95%); }
        code.highlight { padding: .1em; border-radius: .3em; }
        pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
        .highlight .c { color: #708090 } /* Comment */
        .highlight .k { color: #990055 } /* Keyword */
        .highlight .l { color: #000000 } /* Literal */
        .highlight .n { color: #0077aa } /* Name */
        .highlight .o { color: #999999 } /* Operator */
        .highlight .p { color: #999999 } /* Punctuation */
        .highlight .cm { color: #708090 } /* Comment.Multiline */
        .highlight .cp { color: #708090 } /* Comment.Preproc */
        .highlight .c1 { color: #708090 } /* Comment.Single */
        .highlight .cs { color: #708090 } /* Comment.Special */
        .highlight .kc { color: #990055 } /* Keyword.Constant */
        .highlight .kd { color: #990055 } /* Keyword.Declaration */
        .highlight .kn { color: #990055 } /* Keyword.Namespace */
        .highlight .kp { color: #990055 } /* Keyword.Pseudo */
        .highlight .kr { color: #990055 } /* Keyword.Reserved */
        .highlight .kt { color: #990055 } /* Keyword.Type */
        .highlight .ld { color: #000000 } /* Literal.Date */
        .highlight .m { color: #000000 } /* Literal.Number */
        .highlight .s { color: #a67f59 } /* Literal.String */
        .highlight .na { color: #0077aa } /* Name.Attribute */
        .highlight .nc { color: #0077aa } /* Name.Class */
        .highlight .no { color: #0077aa } /* Name.Constant */
        .highlight .nd { color: #0077aa } /* Name.Decorator */
        .highlight .ni { color: #0077aa } /* Name.Entity */
        .highlight .ne { color: #0077aa } /* Name.Exception */
        .highlight .nf { color: #0077aa } /* Name.Function */
        .highlight .nl { color: #0077aa } /* Name.Label */
        .highlight .nn { color: #0077aa } /* Name.Namespace */
        .highlight .py { color: #0077aa } /* Name.Property */
        .highlight .nt { color: #669900 } /* Name.Tag */
        .highlight .nv { color: #222222 } /* Name.Variable */
        .highlight .ow { color: #999999 } /* Operator.Word */
        .highlight .mb { color: #000000 } /* Literal.Number.Bin */
        .highlight .mf { color: #000000 } /* Literal.Number.Float */
        .highlight .mh { color: #000000 } /* Literal.Number.Hex */
        .highlight .mi { color: #000000 } /* Literal.Number.Integer */
        .highlight .mo { color: #000000 } /* Literal.Number.Oct */
        .highlight .sb { color: #a67f59 } /* Literal.String.Backtick */
        .highlight .sc { color: #a67f59 } /* Literal.String.Char */
        .highlight .sd { color: #a67f59 } /* Literal.String.Doc */
        .highlight .s2 { color: #a67f59 } /* Literal.String.Double */
        .highlight .se { color: #a67f59 } /* Literal.String.Escape */
        .highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */
        .highlight .si { color: #a67f59 } /* Literal.String.Interpol */
        .highlight .sx { color: #a67f59 } /* Literal.String.Other */
        .highlight .sr { color: #a67f59 } /* Literal.String.Regex */
        .highlight .s1 { color: #a67f59 } /* Literal.String.Single */
        .highlight .ss { color: #a67f59 } /* Literal.String.Symbol */
        .highlight .vc { color: #0077aa } /* Name.Variable.Class */
        .highlight .vg { color: #0077aa } /* Name.Variable.Global */
        .highlight .vi { color: #0077aa } /* Name.Variable.Instance */
        .highlight .il { color: #000000 } /* Literal.Number.Integer.Long */
        </style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Scroll Snapping Change Proposal</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Unofficial Proposal Draft, <time class="dt-updated" datetime="2016-08-02">2 August 2016</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://drafts.csswg.org/css-scroll-snap/">https://drafts.csswg.org/css-scroll-snap/</a>
     <dt>Issue Tracking:
     <dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
     <dd><a href="#issues-index">Inline In Spec</a>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins-Bittner</a> (<span class="p-org org">Google</span>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad / fantasai</a> (<span class="p-org org">Invited Expert</span>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
  <div class="p-summary" data-fill-with="abstract">
   <p>A brief description of an alternate model for scroll-snapping.</p>
    <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents 
(such as HTML and XML) 
on screen, on paper, in speech, etc.
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p></p>
  </div>
  <div data-fill-with="at-risk">
   <p>The following features are at-risk, and may be dropped during the CR period: </p>
   <ul>
    <li><a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-point">point</a> value of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type">scroll-snap-type</a>
   </ul>
   <p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
  </div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li><a href="#use-cases"><span class="secno">2</span> <span class="content">Use Cases</span></a>
    <li><a href="#proposal"><span class="secno">3</span> <span class="content">Overview of Change</span></a>
    <li><a href="#snap-model"><span class="secno">4</span> <span class="content">Scroll Snapping Model</span></a>
    <li>
     <a href="#snap-container"><span class="secno">5</span> <span class="content">Capturing Scroll Snap Areas: Properties on the scroll container</span></a>
     <ol class="toc">
      <li><a href="#snap-type"><span class="secno">5.1</span> <span class="content">Scroll Snapping Rules: the <span class="property">scroll-snap-type</span> property</span></a>
      <li><a href="#snap-padding"><span class="secno">5.2</span> <span class="content">Scroll Snapport: the <span class="property">scroll-snap-padding</span> property</span></a>
     </ol>
    <li>
     <a href="#element"><span class="secno">6</span> <span class="content">Aligning Scroll Snap Areas: Properties on the scrolling content</span></a>
     <ol class="toc">
      <li><a href="#scroll-snap-areas"><span class="secno">6.1</span> <span class="content">Scroll Snapping Margin: the <span class="property">scroll-snap-margin</span> property</span></a>
      <li>
       <a href="#scroll-snap-alignment"><span class="secno">6.2</span> <span class="content">Scroll Snapping Alignment: the <span class="property">scroll-snap-align</span> property</span></a>
       <ol class="toc">
        <li><a href="#snap-scope"><span class="secno">6.2.1</span> <span class="content"> Scoping Valid Snap Positions to Visible Boxes</span></a>
        <li><a href="#snap-overflow"><span class="secno">6.2.2</span> <span class="content"> Snapping Boxes that Overflow the Scrollport</span></a>
        <li><a href="#unreachable"><span class="secno">6.2.3</span> <span class="content"> Unreachable Snap Areas</span></a>
       </ol>
      <li><a href="#scroll-snap-stop"><span class="secno">6.3</span> <span class="content">Scroll Snap Limits: the <span class="property">scroll-snap-stop</span> property</span></a>
     </ol>
    <li>
     <a href="#snap-concepts"><span class="secno">7</span> <span class="content">Snapping Mechanics</span></a>
     <ol class="toc">
      <li><a href="#scroll-types"><span class="secno">7.1</span> <span class="content">Types of Scrolling Methods</span></a>
      <li><a href="#snap-dimensions"><span class="secno">7.2</span> <span class="content">Axis vs Point-Snapping</span></a>
      <li><a href="#choosing"><span class="secno">7.3</span> <span class="content">Choosing Snap Positions</span></a>
     </ol>
    <li>
     <a href="#longhands"><span class="secno"></span> <span class="content">Appendix A: Longhands</span></a>
     <ol class="toc">
      <li><a href="#padding-longhands-physical"><span class="secno"></span> <span class="content">Physical Longhands for <span class="property">scroll-snap-padding</span></span></a>
      <li><a href="#padding-longhands-logical"><span class="secno"></span> <span class="content">Flow-relative Longhands for <span class="property">scroll-snap-padding</span></span></a>
      <li><a href="#area-longhands-physical"><span class="secno"></span> <span class="content">Physical Longhands for <span class="property">scroll-snap-margin</span></span></a>
      <li><a href="#area-longhands-logical"><span class="secno"></span> <span class="content">Flow-relative Longhands for <span class="property">scroll-snap-margin</span></span></a>
     </ol>
    <li><a href="#priv-sec"><span class="secno">8</span> <span class="content">Privacy and Security Considerations</span></a>
    <li><a href="#acknowledgements"><span class="secno">9</span> <span class="content">Acknowledgements</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>We think scroll snapping is a great idea, and fully support exposing this functionality through CSS. However, a major weakness of the current spec is the way it conceives snapping on a coordinate model rather than a box model. This requires a lot of manual calculations in figuring out the correct coordinates from the box model; and also makes sensible scroll-snap settings dependent on the relative sizes of the viewport and the snappable contents, causing problems for users are unexpectedly large and/or small screens (a problem commonly ignored by many authors).</p>
   <p>This proposal builds off of roc’s model, using an area-snapping model to intelligently handle adaptation to multiple screen sizes. It also adds group alignment as a built-in concept, rather than requiring authors to build one in JavaScript.</p>
   <h2 class="heading settled" data-level="2" id="use-cases"><span class="secno">2. </span><span class="content">Use Cases</span><a class="self-link" href="#use-cases"></a></h2>
   <div class="example" id="example-00540445">
    <a class="self-link" href="#example-00540445"></a> Use Case 1: Snapping to the start or middle of each box
	e.g. address book (start) or photo album (middle) 
    <ol>
     <li data-md="">
      <p>Snapping to 0.25rem above the top of each heading</p>
<pre class="lang-css highlight"><span></span><span class="nt">:root </span><span class="p">{</span> <span class="k">scroll-snap-type</span><span class="p">:</span> proximity<span class="p">;</span> <span class="p">}</span>
<span class="nt">h1, h2, h3, h4, h5, h6 </span><span class="p">{</span>
  <span class="k">scroll-snap-align</span><span class="p">:</span> start<span class="p">;</span>
  <span class="k">scroll-snap-margin</span><span class="p">:</span> <span class="m">0</span>.25em;
}
</pre>
     <li data-md="">
      <p>Snapping to the center of each photo</p>
<pre class="lang-css highlight"><span></span><span class="nt">:root </span><span class="p">{</span> <span class="k">scroll-snap-type</span><span class="p">:</span> mandatory<span class="p">;</span> <span class="p">}</span>
<span class="nt">img </span><span class="p">{</span> <span class="k">scroll-snap-align</span><span class="p">:</span> center<span class="p">;</span> <span class="p">}</span>
</pre>
    </ol>
   </div>
   <div class="example" id="example-ede71b3c">
    <a class="self-link" href="#example-ede71b3c"></a> Use Case 2: Snapping to boxes (or points) in 2D
	e.g. on a map, where you want to snap points of interest to the
	center, or a flow-chart diagram, where you want to snap the edges
	of each box into the visible area. In both cases, you don’t want
	objects wholly outside the visible area to influence snapping. 
    <ol>
     <li data-md="">
      <p>Snapping each flow chart entry to within the viewport when it falls near the edge:</p>
<pre class="lang-css highlight"><span></span><span class="nt">:root </span><span class="p">{</span>
  <span class="k">scroll-snap-type</span><span class="p">:</span> proximity<span class="p">;</span>
<span class="p">}</span>
<span class="nt">li </span><span class="p">{</span>
  <span class="k">scroll-snap-align</span><span class="p">:</span> start<span class="p">;</span>
<span class="p">}</span>
</pre>
     <li data-md="">
      <p>Snapping each city on a map to the center of the viewport,
but only once it gets near the center in both dimensions:</p>
<pre class="lang-css highlight"><span></span><span class="nt">:root </span><span class="p">{</span>
  <span class="k">scroll-snap-type</span><span class="p">:</span> proximity<span class="p">;</span>
<span class="p">}</span>
<span class="nt">.city </span><span class="p">{</span>
  <span class="k">scroll-snap-align</span><span class="p">:</span> center<span class="p">;</span>
<span class="p">}</span>
</pre>
    </ol>
   </div>
   <div class="example" id="example-002b6804">
    <a class="self-link" href="#example-002b6804"></a> Use Case 3: Slideshow, where successive slides are arranged horizontally,
	and sometimes "detail" slides are placed below the "main" slide for that point. 
<pre class="lang-html highlight"><span></span><span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slides"</span><span class="p">></span>
  <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide"</span><span class="p">></span>...<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
  <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide"</span><span class="p">></span>...<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
  <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide details"</span><span class="p">></span>
    <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide"</span><span class="p">></span>...<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
    <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide"</span><span class="p">></span>...<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
  <span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
  <span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"slide"</span><span class="p">></span>...<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
<span class="p">&lt;/</span><span class="nt">div</span><span class="p">></span>
<span class="p">&lt;</span><span class="nt">style</span><span class="p">></span>
<span class="nc">.slides</span> <span class="p">{</span>
  <span class="nb">display</span><span class="o">:</span> <span class="n">flex</span><span class="p">;</span>
  <span class="n">flex</span><span class="o">-</span><span class="n">flow</span><span class="o">:</span> <span class="n">row</span><span class="p">;</span>
  <span class="nb">scroll</span><span class="o">-</span><span class="n">snap</span><span class="o">-</span><span class="n">type</span><span class="o">:</span> <span class="n">mandatory</span><span class="p">;</span>
  <span class="nb">overflow-x</span><span class="o">:</span> <span class="nb">scroll</span><span class="p">;</span>
  <span class="nb">width</span><span class="o">:</span> <span class="m">100</span><span class="n">vw</span><span class="p">;</span>
  <span class="nb">height</span><span class="o">:</span> <span class="m">100</span><span class="n">vh</span><span class="p">;</span>
<span class="p">}</span>
<span class="nc">.slide</span> <span class="p">{</span>
  <span class="nb">scroll</span><span class="o">-</span><span class="n">snap</span><span class="o">-</span><span class="n">align</span><span class="o">:</span> <span class="n">start</span><span class="p">;</span>
  <span class="nb">width</span><span class="o">:</span> <span class="m">100</span><span class="n">vw</span><span class="p">;</span>
  <span class="nb">min-height</span><span class="o">:</span> <span class="m">100</span><span class="n">vh</span><span class="p">;</span>
<span class="p">}</span>
<span class="nc">.slide.details</span> <span class="p">{</span>
  <span class="nb">display</span><span class="o">:</span> <span class="n">flex</span><span class="p">;</span>
  <span class="n">flex</span><span class="o">-</span><span class="n">flow</span><span class="o">:</span> <span class="n">column</span><span class="p">;</span>
  <span class="nb">scroll</span><span class="o">-</span><span class="n">snap</span><span class="o">-</span><span class="n">type</span><span class="o">:</span> <span class="n">mandatory</span><span class="p">;</span>
  <span class="nb">overflow-y</span><span class="o">:</span> <span class="nb">scroll</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">&lt;/</span><span class="nt">style</span><span class="p">></span>
</pre>
   </div>
   <h2 class="heading settled" data-level="3" id="proposal"><span class="secno">3. </span><span class="content">Overview of Change</span><a class="self-link" href="#proposal"></a></h2>
   <p>On the scroll container:</p>
   <table class="data">
    <thead>
     <tr>
      <th>Spec 
      <th>Proposal 
      <th>Priority 
    <tbody>
     <tr>
      <td><a class="css" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-1">scroll-snap-type: none | mandatory | proximity</a> 
      <td><a class="css" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-2">scroll-snap-type: none | [ mandatory | proximity ] || [ x | y | block | inline | both | point]</a> 
      <td>High priority 
     <tr>
      <td>''scroll-snap-destination: <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position">&lt;position></a>'' 
      <td>''scroll-snap-padding: [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> | <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a> ]{1,4}'' 
      <td>
   </table>
   <p>On the children:</p>
   <table class="data">
    <thead>
     <tr>
      <th>Spec 
      <th>Proposal 
      <th>Priority 
    <tbody>
     <tr>
      <td>''scroll-snap-coordinate: <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position">&lt;position></a>#'' 
      <td><a class="css" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-1">scroll-snap-align: [ none | start | end | center ]{1,2}</a> 
      <td>High priority 
     <tr>
      <td>n/a 
      <td>''scroll-snap-margin: <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a>{1,4}'' 
      <td>High priority 
   </table>
   <h2 class="heading settled" data-level="4" id="snap-model"><span class="secno">4. </span><span class="content">Scroll Snapping Model</span><a class="self-link" href="#snap-model"></a></h2>
   <p>This module introduces control over <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snap position" data-lt="scroll snap position" data-noexport="" id="scroll-snap-position">scroll snap positions</dfn>,
	which are scroll positions that produce particular alignments
	of content within a scrollable viewport.
	Using the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-3">scroll-snap-type</a> property on the relevant <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
	the author can request a particular bias
	for the viewport to land on a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-1">snap position</a> after scrolling operations.</p>
   <p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-2">Snap positions</a> are specified
	as a particular alignment (<a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-2">scroll-snap-align</a>)
	of a box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-1">scroll snap area</a> (its border bounding box, as modified by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-1">scroll-snap-margin</a>)
	within the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-1">snapport</a> (its scrollport, as reduced by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-1">scroll-snap-padding</a>).
	This is conceptually equivalent to specifying the alignment of
	an <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a> within an <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>.
	A scroll position that satisfies the specified alignment
	is a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-3">snap position</a>.</p>
   <p>The act of adjusting the scroll position
	of a scroll container’s scrollport
	such that it is aligned to a snap position
	is called <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="snap | snapping | snapped" data-noexport="" id="snap">snapping</dfn>,
	and a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is said to be <a data-link-type="dfn" href="#snap" id="ref-for-snap-1">snapped</a> to a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-4">snap position</a> if its scrollport’s scroll position
	is that <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-5">snap position</a> and there is no active scrolling operation.
	The CSS Scroll Snap Module
	intentionally does not specify nor mandate
	any precise animations or physics used to enforce <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-6">snap positions</a>;
	this is left up to the user agent.</p>
   <p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-7">Snap positions</a> only affect the nearest ancestor <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> on the element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block-chain">containing block chain</a>.</p>
   <h2 class="heading settled" data-level="5" id="snap-container"><span class="secno">5. </span><span class="content">Capturing Scroll Snap Areas: Properties on the scroll container</span><a class="self-link" href="#snap-container"></a></h2>
   <h3 class="heading settled" data-level="5.1" id="snap-type"><span class="secno">5.1. </span><span class="content">Scroll Snapping Rules: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-4">scroll-snap-type</a> property</span><a class="self-link" href="#snap-type"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-type">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-type">scroll-snap-type</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> [ proximity <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> mandatory ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-any">||</a> [ x <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> y <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> block <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> inline <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> both <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> point ]
     <tr>
      <th>Initial:
      <td>none
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified
     <tr>
      <th>Animatable:
      <td>no
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-5">scroll-snap-type</a> property specifies
	whether a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is a <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-1">scroll snap container</a>,
	how strictly it <a data-link-type="dfn" href="#snap" id="ref-for-snap-2">snaps</a>,
	and which axes are considered.</p>
   <p class="issue" id="issue-cdf7fb7c"><a class="self-link" href="#issue-cdf7fb7c"></a> <a href="https://lists.w3.org/Archives/Public/www-style/2015Nov/0328.html">We’re considering splitting this into subproperties.</a> Current proposed names are <span class="css">scroll-snap</span> for the current grammar, <span class="css">scroll-snap-affinity</span> for the proximity/mandatory distinction,
	and <span class="css">scroll-snap-axis</span> for the x/y/etc distinction.</p>
   <p>The <dfn data-dfn-type="dfn" data-lt="strictness value" data-noexport="" id="strictness-value">strictness values<a class="self-link" href="#strictness-value"></a></dfn> (<a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-1">none</a>, <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-proximity" id="ref-for-valdef-scroll-snap-type-proximity-1">proximity</a>, <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-mandatory" id="ref-for-valdef-scroll-snap-type-mandatory-1">mandatory</a>)
	specify how strictly <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-8">snap positions</a> are enforced on the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> (by forcing an adjustment to the scroll position).
	Values are defined as follows:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-none">none</dfn> 
    <dd>
      If specified on a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> must not <a data-link-type="dfn" href="#snap" id="ref-for-snap-3">snap</a>:
			all scroll positions are equally valid. 
     <p>If specified on a non-<a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			this value has no effect.</p>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-proximity">proximity</dfn> 
    <dd>
      If specified on a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> may <a data-link-type="dfn" href="#snap" id="ref-for-snap-4">snap</a> to a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-9">snap position</a> at the termination of a scroll,
			at the discretion of the UA given the parameters of the scroll. 
     <p>If specified on a non-<a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			this value “traps” descendant boxes’ <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-10">snap positions</a>,
			preventing them from affecting any ancestor <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a>.</p>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-mandatory">mandatory</dfn> 
    <dd>
      If specified on a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is required to be <a data-link-type="dfn" href="#snap" id="ref-for-snap-5">snapped</a> to a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-11">snap position</a> when there are no active scrolling operations.
			That is, it must <a data-link-type="dfn" href="#snap" id="ref-for-snap-6">snap</a> to a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-12">snap position</a> at the termination of a scroll, if any such exist.
			(If none exist, then no snapping occurs.) 
     <p>If specified on a non-<a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>,
			this value “traps” descendant boxes’ <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-13">snap positions</a>,
			preventing them from affecting any ancestor <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a>.</p>
   </dl>
   <p>A box <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" id="captures-snap-positions">captures snap positions</dfn> if it is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <em>or</em> has a value other than <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-2">none</a> for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-6">scroll-snap-type</a>.
	If a box’s nearest <a data-link-type="dfn" href="#captures-snap-positions" id="ref-for-captures-snap-positions-1">snap-position capturing</a> ancestor
	on its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block-chain">containing block chain</a> is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> with a non-<a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-3">none</a> value for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-7">scroll-snap-type</a>,
	that is the box’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="snap container" id="scroll-snap-container">scroll snap container</dfn>.
	Otherwise, the box has no <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-2">scroll snap container</a>,
	and its <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-14">snap positions</a> do not trigger <a data-link-type="dfn" href="#snap" id="ref-for-snap-7">snapping</a>.</p>
    <strong class="advisement"> Authors should use mandatory snap positions with consideration of
	varyingly-sized screens and (if applicable) varying-sized content.
	In particular, although access to snapped elements larger than the viewport
	is <a href="#snap-overflow">handled by the UA</a>,
	if authors assign mandatory snapping to non-adjacent siblings,
	content in between can become inaccessible
	in cases where it is longer than the screen.</strong> 
   <div class="example" id="example-0740e5d8">
    <a class="self-link" href="#example-0740e5d8"></a> For example, if an author wishes to force snapping to the top of each section heading,
		s/he could accomplish this in two ways: snapping the headings 
<pre>h1, h2, h3, h4, h5, h6 { scroll-snap-align: start; } /* snap headings - but not section content */</pre>
    <p>or snapping the section elements.</p>
<pre>section { scroll-snap-align: start; }                /* snap entire section - including content */</pre>
    <p>If the author chooses mandatory snapping of the headings,
		and one section is longer than the viewport,
		then the reader will have difficulty accessing the content that overflows the screen,
		because mandatory snapping does not allow the scroll position to rest
		on the content between the snapped headings.</p>
    <p>However, if the author chooses mandatory snapping of the section element
		(which contains all the content of the section)
		then the UA can allow the reader to scroll freely through the entire section
		in the cases where the content is longer than the screen.</p>
   </div>
   <p>The <dfn data-dfn-type="dfn" data-lt="axis value" data-noexport="" id="axis-value">axis values<a class="self-link" href="#axis-value"></a></dfn> specify what axis(es) are affected by <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-15">snap positions</a>,
	and whether <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-16">snap positions</a> are evaluated independently per axis,
	or together as a 2D point.
	Values are defined as follows:</p>
   <dl>
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-x">x<a class="self-link" href="#valdef-scroll-snap-type-x"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-1">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-17">snap positions</a> in its horizontal axis only. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-y">y<a class="self-link" href="#valdef-scroll-snap-type-y"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-2">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-18">snap positions</a> in its vertical axis only. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-block">block<a class="self-link" href="#valdef-scroll-snap-type-block"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-3">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-19">snap positions</a> in its block axis only. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-inline">inline<a class="self-link" href="#valdef-scroll-snap-type-inline"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-4">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-20">snap positions</a> in its inline axis only. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-both">both<a class="self-link" href="#valdef-scroll-snap-type-both"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-5">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-21">snap positions</a> in both of its axises independently
			(potentially snapping to different elements in each axis). 
    <dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-point">point<a class="self-link" href="#valdef-scroll-snap-type-point"></a></dfn> 
    <dd> The <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-1">point-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-22">snap positions</a> in both axises simultaneously,
			treating each element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-23">snap position</a> as a single 2D position
			(rather than potentially snapping to different elements in each axis). 
   </dl>
   <p>If no axis value is specified, then the axis is automatically computed:</p>
   <ul>
    <li data-md="">
     <p>If the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is only scrollable in one axis
(only one axis has its <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow">overflow</a> set to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-auto">auto</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-scroll">scroll</a>)
it <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-6">axis-snaps</a> in the scrollable axis only.</p>
    <li data-md="">
     <p>Otherwise, it <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-7">axis-snaps</a> in its <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#block-axis">block axis</a> only.</p>
   </ul>
   <p>If the content or layout of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> changes
	(e.g. content is added, moved, deleted, resized),
	the UA must re-evaluate, and potentially re-<a data-link-type="dfn" href="#snap" id="ref-for-snap-8">snap</a> if necessary,
	the resulting scroll position
	once the positions of the content have restabilized.
	This can result in no snapping in some cases
	(e.g. if there are no nearby <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-24">snap positions</a> for a <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-proximity" id="ref-for-valdef-scroll-snap-type-proximity-2">proximity</a>-snapping <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>).
	However, if there was a previously-<a data-link-type="dfn" href="#snap" id="ref-for-snap-9">snapped</a> <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-25">snap position</a> (associated with the same element)
	that still exists after such changes,
	the UA must remain <a data-link-type="dfn" href="#snap" id="ref-for-snap-10">snapped</a> to it—<wbr>even if the changes would have placed a different <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-26">snap position</a> closer to the current scroll position.
	Otherwise, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> must be re-<a data-link-type="dfn" href="#snap" id="ref-for-snap-11">snapped</a> as if the user had scrolled to its current scroll position
	(as an <a data-link-type="dfn" href="#explicit-scroll" id="ref-for-explicit-scroll-1">explicit scroll</a>, if no other scroll operation is active).</p>
   <h3 class="heading settled" data-level="5.2" id="snap-padding"><span class="secno">5.2. </span><span class="content">Scroll Snapport: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-2">scroll-snap-padding</a> property</span><a class="self-link" href="#snap-padding"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-padding">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding">scroll-snap-padding</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,4}</a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>relative to the corresponding dimension of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s scrollport
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length, percentage, or calc
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-3">scroll-snap-padding</a> property defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snapport" data-noexport="" id="scroll-snapport">scroll snapport</dfn>—<wbr>the area of the scrollport that is used as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a> for the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-2">scroll snap areas</a> when calculating <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-27">snap positions</a>.
	Values are interpreted as for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding">padding</a>,
	and specify inward offsets from each edge of the scrollport.</p>
   <div class="example" id="example-3435d351">
    <a class="self-link" href="#example-3435d351"></a> In this example, points of interest in a map are centered
		within the portion of the viewport that does not include the toolbar overlay. 
<pre>map {
  overflow: scroll;
  scroll-snap-type: proximity;
  scroll-snap-padding: 3em 0 0 0;
}
toolbar {
  position: absolute;
  margin: 0.5em;
  top: 0; left: 0; right: 0;
  height: 2em;
}
city {
  scroll-snap-align: center;
}
</pre>
   </div>
   <p>This property is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand property</a> that sets
	all of the <a href="#longhands"><span class="css">scroll-snap-padding-*</span> longhands</a> in one declaration.</p>
   <h2 class="heading settled" data-level="6" id="element"><span class="secno">6. </span><span class="content">Aligning Scroll Snap Areas: Properties on the scrolling content</span><a class="self-link" href="#element"></a></h2>
   <h3 class="heading settled" data-level="6.1" id="scroll-snap-areas"><span class="secno">6.1. </span><span class="content">Scroll Snapping Margin: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-2">scroll-snap-margin</a> property</span><a class="self-link" href="#scroll-snap-areas"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-margin">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin">scroll-snap-margin</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,4}</a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-3">scroll-snap-margin</a> property defines
	the <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snap area" data-noexport="" id="scroll-snap-area">scroll snap area</dfn> that is used for snapping this box to the viewport.
	The <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> values give outsets
	(interpreted as for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-margin">margin</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-outset">border-image-outset</a>).
	The <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-3">scroll snap area</a> is the rectangular bounding box of the transformed border box,
	plus the specified outsets,
	axis-aligned in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container’s</a> coordinate space.</p>
   <p class="note" role="note">Note: This ensures that the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-4">scroll snap area</a> is always rectangular
	and axis-aligned to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container’s</a> coordinate space.</p>
   <p>This property is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand property</a> that sets
	all of the <a href="#longhands"><span class="css">scroll-snap-margin-*</span> longhands</a> in one declaration.</p>
   <h3 class="heading settled" data-level="6.2" id="scroll-snap-alignment"><span class="secno">6.2. </span><span class="content">Scroll Snapping Alignment: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-3">scroll-snap-align</a> property</span><a class="self-link" href="#scroll-snap-alignment"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-align">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-align">scroll-snap-align</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod">[ none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> start <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> end <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> center ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
     <tr>
      <th>Initial:
      <td>none
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>two keywords
     <tr>
      <th>Animatable:
      <td>no
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-4">scroll-snap-align</a> property specifies
	the box’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-28">snap position</a> as an alignment of
	its <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-5">snap area</a> (as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a>)
	within its <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-3">snap container’s</a> <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-2">snapport</a> (as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>).
	The two values specify snapping alignment
	in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#inline-axis">inline axis</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#block-axis">block axis</a>, respectively.
	If only one value is specified, the second value defaults to the same value.</p>
   <div class="example" id="example-b4976a9e">
    <a class="self-link" href="#example-b4976a9e"></a> The following example aligns the start edge of the box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-6">snap area</a> to the start edge of the scroll container’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-3">snapport</a>: 
<pre>section { scroll-snap-align: start; }</pre>
    <p>The following example aligns the center of each city
		to the center of the scroll container’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-4">snapport</a>,
		snapping only when the city is centered in both axes:</p>
<pre>.map { scroll-snap-type: proximity point; }
.map .city { scroll-snap-align: center; }
</pre>
    <p>The following example aligns the center of each photo
		to the center of the scroll container’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-5">snapport</a>,
		snapping independently in each axis:</p>
<pre>.photos { scroll-snap-type: mandatory both; }
img { scroll-snap-align: center; }
</pre>
   </div>
   <p>Values are defined as follows:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-none">none</dfn> 
    <dd> This box does not define a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-29">snap position</a> in the specified axis. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-start">start<a class="self-link" href="#valdef-scroll-snap-align-start"></a></dfn> 
    <dd> Start alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-7">scroll snap area</a> within the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-6">snapport</a> is a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-30">snap position</a> in the specified axis. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-end">end<a class="self-link" href="#valdef-scroll-snap-align-end"></a></dfn> 
    <dd> End alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-8">scroll snap area</a> within the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-7">snapport</a> is a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-31">snap position</a> in the specified axis. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-center">center<a class="self-link" href="#valdef-scroll-snap-align-center"></a></dfn> 
    <dd> Center alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-9">scroll snap area</a> within the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-8">snapport</a> is a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-32">snap position</a> in the specified axis. 
   </dl>
   <p>If the element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-2">point-snapping</a>,
	and this property does not specify a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-33">snap position</a> in both axises
	(that is, it contains <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-align-none" id="ref-for-valdef-scroll-snap-align-none-1">none</a>),
	the element does not contribute any <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-34">snap positions</a> at all.</p>
   <p>For all of these values,
	the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#block">block</a> or <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline">inline</a> axis
	is relative to the element’s parent’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#writing-mode">writing mode</a>.</p>
   <p class="issue" id="issue-eb80fe83"><a class="self-link" href="#issue-eb80fe83"></a> Is this the correct writing mode to compute against?
	Or should it be the scroll container’s writing mode?</p>
   <details class="note" role="note">
    <summary>Why no <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> or <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position">&lt;position></a> values?</summary>
    <p>The values here represent alignments
		(in the sense of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">align-self</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-align-3/#propdef-justify-self">justify-self</a>),
		so are consistent with that syntax.
		We chose to use this simpler syntax without lengths or percentages
		because the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-4">scroll-snap-margin</a> concept already provides length offsets—<wbr>but does so in a smarter way, that degrades better on small screens (see above)
		because it provides more information (a box, rather than a point) to the UA.
		We could have also added lengths here,
		but it would provide multiple ways to do the same thing,
		which is additional overhead for implementation, testing, and (most importantly) author learning.
		It also introduces more room for cascading errors,
		and guides authors in the wrong direction—<wbr>away from <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-5">scroll-snap-margin</a>.</p>
   </details>
   <h4 class="heading settled" data-level="6.2.1" id="snap-scope"><span class="secno">6.2.1. </span><span class="content"> Scoping Valid Snap Positions to Visible Boxes</span><a class="self-link" href="#snap-scope"></a></h4>
   <p>Since the purpose of scroll snapping is to align content within the viewport
	for optimal viewing:
	in all cases, the specified alignment creates a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-35">snap position</a> only if at least part of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-10">snap area</a> is within the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-9">snapport</a>.
	For example, a <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-11">snap area</a> is top-aligned to the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-10">snapport</a> if its top edge is coincident with the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-11">snapport</a>’s top edge;
	however, this alignment is nonetheless not a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-36">snap position</a> if the entire <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-12">snap area</a> is outside the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-12">snapport</a>.</p>
   <details class="note" role="note">
    <summary>Why limit snapping to only when the element is visible?</summary>
     As the <a href="https://www.webkit.org/blog/4017/scroll-snapping-with-css-snap-points/">WebKit implementers point out</a>,
		extending a snap edge infinitely across the canvas
		only allows for snapping gridded layouts,
		and produces odd behavior for the user
		when off-screen elements do not align
		with on-screen elements.
		(If this requirement is onerous for implementers however,
		we can default to a gridded behavior
		and introduce a switch to get smarter behavior.) 
   </details>
   <h4 class="heading settled" data-level="6.2.2" id="snap-overflow"><span class="secno">6.2.2. </span><span class="content"> Snapping Boxes that Overflow the Scrollport</span><a class="self-link" href="#snap-overflow"></a></h4>
   <p>If the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-13">snap area</a> is larger than the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-13">snapport</a> in a particular axis,
	and there are no other <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-14">snap areas</a> within the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-14">snapport</a> that would provide a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-37">snap position</a> aligning the overflowing <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-15">snap area</a> within the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-15">snapport</a>,
	then any scroll position in which the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-16">snap area</a> covers the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-16">snapport</a> is a valid <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-38">snap position</a> in that axis.
	The UA may use the specified alignment as a more precise target
	for certain scroll operations (e.g. inertial scrolling or explicit paging).</p>
   <div class="example" id="example-9e711241">
    <a class="self-link" href="#example-9e711241"></a> For example, take the third code fragment in the previous example,
		which had a photo as the area.
		The author wants mandatory snapping from item to item,
		but if the item happens to be larger than your viewport,
		you want to be able to scroll around the whole thing once you’re over it. 
    <p>Since the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-17">snap area</a> is larger than the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-17">snapport</a>,
		while the area fully fills the viewport,
		the container can be scrolled arbitrarily and will not try to snap back to its aligned position.
		However, if the container is scrolled such that the area
		no longer fully fills the viewport in an axis,
		the area resists outward scrolling
		until you fling out or pull it sufficiently to trigger snapping to a different <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-39">snap position</a>.</p>
   </div>
   <h4 class="heading settled" data-level="6.2.3" id="unreachable"><span class="secno">6.2.3. </span><span class="content"> Unreachable Snap Areas</span><a class="self-link" href="#unreachable"></a></h4>
   <p>If a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-40">snap position</a> is unreachable as specified,
	such that aligning to it would require scrolling the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s viewport
	past the edge of its <a data-link-type="dfn">scrollable area</a>,
	the <em>used</em> <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-41">snap position</a> for this <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-18">snap area</a> is the position resulting from scrolling <em>as much as possible</em> in each relevant axis
	toward the desired <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-42">snap position</a>.</p>
   <h3 class="heading settled" data-level="6.3" id="scroll-snap-stop"><span class="secno">6.3. </span><span class="content">Scroll Snap Limits: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-stop" id="ref-for-propdef-scroll-snap-stop-1">scroll-snap-stop</a> property</span><a class="self-link" href="#scroll-snap-stop"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-stop">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-stop">scroll-snap-stop</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod">normal <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> always
     <tr>
      <th>Initial:
      <td>normal
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified
     <tr>
      <th>Animatable:
      <td>no
   </table>
   <p>This property specifies whether the <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-43">snap position</a> absorbs all remaining inertia during an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-1">inertial scroll</a>,
	or allows the <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-2">inertial scroll</a> to pass multiple <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-44">snap positions</a> before coming to rest.
	Values are defined as follows:</p>
   <dl>
    <dt><dfn class="css" data-dfn-for="scroll-snap-stop" data-dfn-type="value" data-export="" id="valdef-scroll-snap-stop-normal">normal<a class="self-link" href="#valdef-scroll-snap-stop-normal"></a></dfn> 
    <dd> A <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-45">snap position</a> defined by this element
			does not interfere with the inertia
			of an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-3">inertial scroll</a> that is passing across it,
			unless it is the landing <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-46">snap position</a>. 
    <dt><dfn class="css" data-dfn-for="scroll-snap-stop" data-dfn-type="value" data-export="" id="valdef-scroll-snap-stop-always">always<a class="self-link" href="#valdef-scroll-snap-stop-always"></a></dfn> 
    <dd>
      A <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-47">snap position</a> defined by this element,
			when encountered by an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-4">inertial scroll</a>,
			absorbs all remaining inertia from an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-5">inertial scroll</a>,
			forcing a stop at this <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-48">snap position</a>,
			exactly as if the scroll had enough inertia to reach the <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-49">snap position</a>,
			but not enough to escape it. 
     <p class="note" role="note">Note: This means that if all snap positions in a scroller
			have <a class="css" data-link-type="propdesc" href="#propdef-scroll-snap-stop" id="ref-for-propdef-scroll-snap-stop-2">scroll-snap-stop: always</a>,
			an inertial scroll can only move one <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-50">snap position</a> per inertial scroll action.</p>
   </dl>
   <h2 class="heading settled" data-level="7" id="snap-concepts"><span class="secno">7. </span><span class="content">Snapping Mechanics</span><a class="self-link" href="#snap-concepts"></a></h2>
   <p>The precise model algorithm to select a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-51">snap position</a> to snap to
	is intentionally left mostly undefined,
	so that user agents can take into account sophisticated models of user intention and interaction
	and adjust how they respond over time,
	to best serve the user.</p>
   <p>This section defines some useful concepts to aid in discussing scroll-snapping mechanics,
	and provides some guidelines for what an effective scroll-snapping strategy might look like.
	User agents are encouraged to adapt this guidance
	and apply their own best judgement
	when defining their own snapping behavior.
	It also provides a small number of behavior requirements,
	to ensure a minimum reasonable behavior that authors can depend on
	when designing their interfaces with scroll-snapping in mind.</p>
   <h3 class="heading settled" data-level="7.1" id="scroll-types"><span class="secno">7.1. </span><span class="content">Types of Scrolling Methods</span><a class="self-link" href="#scroll-types"></a></h3>
   <p>When a page is scrolled,
	the action is performed with
	an intended end position
	and/or an intended direction.
	Each combination of these two things
	defines a distinct category of scrolling,
	which can be treated slightly differently:</p>
   <dl>
    <dt data-md="">
     <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="explicit" data-lt="explicit scroll" id="explicit-scroll">explicit scrolling</dfn></p>
    <dd data-md="">
     <p>A scroll is <a data-link-type="dfn" href="#explicit-scroll" id="ref-for-explicit-scroll-2">explicit</a> if it has an intended end position,
but no intended direction.</p>
     <p>This includes methods such as:</p>
     <ul>
      <li data-md="">
       <p>a panning gesture,
released without momentum</p>
      <li data-md="">
       <p>manipulating the scrollbar "thumb" explicitly</p>
      <li data-md="">
       <p>programmatically scrolling via APIs such as <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-view-1/#dom-window-scrollto">scrollTo()</a></code></p>
      <li data-md="">
       <p>tabbing through the document’s focusable elements</p>
      <li data-md="">
       <p>navigating to an anchor within the page</p>
     </ul>
    <dt data-md="">
     <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="inertial" data-lt="inertial scroll" id="inertial-scroll">inertial scrolling</dfn></p>
    <dd data-md="">
     <p>A scroll is <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-6">inertial</a> if it has both an intended end position
and an intended direction.</p>
     <p>This includes methods such as:</p>
     <ul>
      <li data-md="">
       <p>a "fling" gesture,
released with momentum
(the "intended" end position might be implicitly determined by the UA’s scrolling physics,
but the strength of the user’s fling still expresses a weak intention
about where the scroll should end up)</p>
      <li data-md="">
       <p>a mousewheel scroll</p>
      <li data-md="">
       <p>programmatically scrolling via APIs such as <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-view-1/#dom-window-scrollby">scrollBy()</a></code></p>
     </ul>
     <p>The scroll position that an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-7">inertial</a> scroll would naturally land on
without further intervention is the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="natural-end-point">natural end-point</dfn>.</p>
    <dt data-md="">
     <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="directional" data-lt="directional scroll" id="directional-scroll">directional scrolling</dfn></p>
    <dd data-md="">
     <p>A scroll is <a data-link-type="dfn" href="#directional-scroll" id="ref-for-directional-scroll-1">directional</a> if it has an intended direction,
but no intended end point.</p>
     <p>This includes methods such as:</p>
     <ul>
      <li data-md="">
       <p>pressing an arrow key on the keyboard</p>
     </ul>
   </dl>
   <p>Additionally, because page layouts usually align things vertically and/or horizontally,
	UAs sometimes <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" id="axis-lock">axis-lock</dfn> a scroll when its direction
	is sufficiently vertical or horizontal.
	An <a data-link-type="dfn" href="#axis-lock" id="ref-for-axis-lock-1">axis-locked</a> scroll is bound to only scroll along that axis.
	This prevents,
	for example,
	a <em>nearly</em> horizontal fling gesture from gradually drifting up or down as well,
	because it is very difficult to fling in a precisely horizontal line.</p>
   <h3 class="heading settled" data-level="7.2" id="snap-dimensions"><span class="secno">7.2. </span><span class="content">Axis vs Point-Snapping</span><a class="self-link" href="#snap-dimensions"></a></h3>
   <p class="issue" id="issue-323279de"><a class="self-link" href="#issue-323279de"></a> This feature is planned to be removed in the next publication
	in order to reduce the feature-set of Level 1.
	It is included here for future reference in defining Level 2.</p>
   <p>There are two distinct <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="snap behavior|snapping behavior" data-noexport="" id="snap-behavior">snapping behaviors</dfn> that a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> might engage in:</p>
   <dl>
    <dt data-md="">
     <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="axis" data-lt="axis-snapping|axis-snap" id="axis-snapping">axis-snapping</dfn></p>
    <dd data-md="">
     <p>If a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-8">axis-snapping</a>,
its descendants indicate a desired scroll position
in each axis of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> independently,
with no dependent preference for what the other axis’s scroll position should be.</p>
     <p class="note" role="note">Note: This is the “default” type of <a data-link-type="dfn" href="#snap-behavior" id="ref-for-snap-behavior-1">snap behavior</a> that most <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a> will want to use,
and so the <span class="css">scroll-snap-type</span> property intentionally defaults to it.</p>
     <p class="note" role="note">Note: An element in an <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-9">axis-snapping</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> can declare two <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-52">snap positions</a>,
one in each axis.
If one of the element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-53">snap positions</a> is chosen in one axis,
this has no bearing on the other dimension’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-54">snap position</a>—<wbr>it might be chosen,
or a different element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-55">snap position</a> might be chosen for that axis,
or that axis might not snap at all.</p>
    <dt data-md="">
     <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="point" data-lt="point-snapping|point-snap" id="point-snapping">point-snapping</dfn></p>
    <dd data-md="">
     <p>If a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-3">point-snapping</a>,
its descendants indicate a desired scroll position
in both axises of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> simultaneously—<wbr>in other words,
some point in the descendant must be aligned to a corresponding point in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>.</p>
     <p>This type of <a data-link-type="dfn" href="#snap-behavior" id="ref-for-snap-behavior-2">snapping behavior</a> is intended for "two-dimensional" panning-type layouts,
such as cities on a map
(using <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-proximity" id="ref-for-valdef-scroll-snap-type-proximity-3">proximity</a> 2D snap positions to snap a city to the center of the display when it gets close),
or a tiled image gallery
(using <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-mandatory" id="ref-for-valdef-scroll-snap-type-mandatory-2">mandatory</a> 2D snap positions to force each image to be centered on the screen).
In both of these cases,
it would look weird if the horizontal scrolling was aligned to one element
while the vertical was aligned to a different element
(which is the behavior you’d get if the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> was <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-10">axis-snapping</a>).</p>
   </dl>
   <h3 class="heading settled" data-level="7.3" id="choosing"><span class="secno">7.3. </span><span class="content">Choosing Snap Positions</span><a class="self-link" href="#choosing"></a></h3>
   <p>A <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> can have many <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-19">snap areas</a> scattered throughout its <a data-link-type="dfn">scrollable area</a>.
	A naive algorithm for selecting a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-56">snap position</a> can produce behavior that is unintuitive for users,
	so care is required when designing a selection algorithm.
	Here are a few pointers that can aid in the selection process:</p>
   <ul>
    <li data-md="">
     <p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-57">Snap positions</a> should be chosen to minimize the distance between the end-point
(or the <a data-link-type="dfn" href="#natural-end-point" id="ref-for-natural-end-point-1">natural end-point</a>)
and the final snapped scroll position,
subject to the additional constraints listed in this section.</p>
    <li data-md="">
     <p><a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-4">Point-snapping</a> is all-or-nothing;
if the <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-58">snap position</a> of an element is chosen to align to,
the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> must set its scroll position
according to the element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-59">snap positions</a> in <em>both</em> axises;
the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> <em>must not</em> “partially align” to the element
by taking its <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-60">snap position</a> in one axis
and aligning the other axis according to something else.</p>
    <li data-md="">
     <p>If a scroll is <a data-link-type="dfn" href="#axis-lock" id="ref-for-axis-lock-2">axis-locked</a> and the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-11">axis-snapping</a>,
any <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-61">snap positions</a> in the other axis should be ignored
during the scroll.
(However, <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-62">snap positions</a> in the other axis can still effect the final scroll position.)</p>
     <p>If a scroll is <a data-link-type="dfn" href="#axis-lock" id="ref-for-axis-lock-3">axis-locked</a> and the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> is <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-5">point-snapping</a>, <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-63">snap positions</a> should be penalized in the selection process
according to the amount of other-axis scrolling they would cause.</p>
    <li data-md="">
     <p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-64">Snap positions</a> should be ignored if their elements are far outside of the “corridor”
that the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-18">snapport</a> defines as it moves through the <a data-link-type="dfn">scrollable area</a> during an <a data-link-type="dfn" href="#inertial-scroll" id="ref-for-inertial-scroll-8">inertial scroll</a>,
or a hypothetical “corridor” in the direction of a <a data-link-type="dfn" href="#directional-scroll" id="ref-for-directional-scroll-2">directional scroll</a>,
or the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-19">snapport</a> after an <a data-link-type="dfn" href="#explicit-scroll" id="ref-for-explicit-scroll-3">explicit scroll</a>.
(This is to prevent a far-offscreen element
from having difficult-to-understand effects
on the scroll position.)</p>
    <li data-md="">
     <p>User agents <em>must</em> ensure that a user can “escape” a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-65">snap position</a>,
regardless of the scroll method.
For example, if the snap type is <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-mandatory" id="ref-for-valdef-scroll-snap-type-mandatory-3">mandatory</a> and the next <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-66">snap position</a> is more than two screen-widths away,
a naïve “always snap to nearest” selection algorithm would “trap” the user
if they were panning with a touch gesture;
a sufficiently large distance would even trap fling scrolling!
Instead, a smarter algorithm that only returned to the starting <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-67">snap position</a> if the end-point was a fairly small distance from it,
and otherwise ignored the starting snap position,
would give better behavior.</p>
     <p>(This implies that a <a data-link-type="dfn" href="#directional-scroll" id="ref-for-directional-scroll-3">directional scroll</a> must always ignore the starting <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-68">snap positions</a>.)</p>
    <li data-md="">
     <p>If a page is navigated to a fragment that defines a target element
(one that would be matched by <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#target-pseudo">:target</a>),
and that element defines some <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-69">snap positions</a>,
the user agent should <a data-link-type="dfn" href="#snap" id="ref-for-snap-12">snap</a> to one of that element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-70">snap positions</a>.
The user agent may do this even when the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a> has <a class="css" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-8">scroll-snap-type: none</a>.</p>
   </ul>
   <h2 class="heading settled" id="longhands"><span class="content">Appendix A: Longhands</span><a class="self-link" href="#longhands"></a></h2>
   <h3 class="heading settled" id="padding-longhands-physical"><span class="content">Physical Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-4">scroll-snap-padding</a></span><a class="self-link" href="#padding-longhands-physical"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-padding-top">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-top">scroll-snap-padding-top<a class="self-link" href="#propdef-scroll-snap-padding-top"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-right">scroll-snap-padding-right<a class="self-link" href="#propdef-scroll-snap-padding-right"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-bottom">scroll-snap-padding-bottom<a class="self-link" href="#propdef-scroll-snap-padding-bottom"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-left">scroll-snap-padding-left<a class="self-link" href="#propdef-scroll-snap-padding-left"></a></dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Percentage:
      <td>relative to the corresponding dimension of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s scrollport
     <tr>
      <th>Animatable:
      <td>as length, percentage, or calc
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-5">scroll-snap-padding</a> specify
	the top, right, bottom, and left edges
	of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-20">snapport</a>,
	respectively.</p>
   <h3 class="heading settled" id="padding-longhands-logical"><span class="content">Flow-relative Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-6">scroll-snap-padding</a></span><a class="self-link" href="#padding-longhands-logical"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-padding-inline-start">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-inline-start">scroll-snap-padding-inline-start</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-block-start">scroll-snap-padding-block-start</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-inline-end">scroll-snap-padding-inline-end</dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-padding-block-end">scroll-padding-block-end<a class="self-link" href="#propdef-scroll-padding-block-end"></a></dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll containers</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>relative to the corresponding dimension of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s scrollport
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length, percentage, or calc
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-7">scroll-snap-padding</a> specify
	the block-start, inline-start, block-end, and inline-end edges
	of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-21">snapport</a>, respectively.</p>
   <table class="def propdef" data-link-for-hint="scroll-snap-padding-block">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-block">scroll-snap-padding-block<a class="self-link" href="#propdef-scroll-snap-padding-block"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-inline">scroll-snap-padding-inline<a class="self-link" href="#propdef-scroll-snap-padding-inline"></a></dfn>
     <tr class="value">
      <th>Value:
      <td class="prod">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>relative to the corresponding dimension of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>’s scrollport
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length, percentage, or calc
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-block-start" id="ref-for-propdef-scroll-snap-padding-block-start-1">scroll-snap-padding-block-start</a> + <a class="property" data-link-type="propdesc">scroll-snap-padding-block-end</a> and <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-inline-start" id="ref-for-propdef-scroll-snap-padding-inline-start-1">scroll-snap-padding-inline-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-inline-end" id="ref-for-propdef-scroll-snap-padding-inline-end-1">scroll-snap-padding-inline-end</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-8">scroll-snap-padding</a>,
	and specify the block-axis and inline-axis edges of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-22">snapport</a>, respectively.</p>
   <p>If two values are specified, the first gives the start value
	and the second gives the end value.</p>
   <h3 class="heading settled" id="area-longhands-physical"><span class="content">Physical Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-6">scroll-snap-margin</a></span><a class="self-link" href="#area-longhands-physical"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-margin-top">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-top">scroll-snap-margin-top<a class="self-link" href="#propdef-scroll-snap-margin-top"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-right">scroll-snap-margin-right<a class="self-link" href="#propdef-scroll-snap-margin-right"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-bottom">scroll-snap-margin-bottom<a class="self-link" href="#propdef-scroll-snap-margin-bottom"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-left">scroll-snap-margin-left<a class="self-link" href="#propdef-scroll-snap-margin-left"></a></dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-7">scroll-snap-margin</a> specify
	the top, right, bottom, and left edges
	of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-20">scroll snap area</a>, respectively.</p>
   <h3 class="heading settled" id="area-longhands-logical"><span class="content">Flow-relative Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-8">scroll-snap-margin</a></span><a class="self-link" href="#area-longhands-logical"></a></h3>
   <table class="def propdef" data-link-for-hint="scroll-snap-margin-block-start">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-block-start">scroll-snap-margin-block-start</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-inline-start">scroll-snap-margin-inline-start</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-block-end">scroll-snap-margin-block-end</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-inline-end">scroll-snap-margin-inline-end</dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
     <tr>
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-9">scroll-snap-margin</a> specify
	the block-start, inline-start, block-end, and inline-end
	edges of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-21">scroll snap area</a>,
	respectively.</p>
   <table class="def propdef" data-link-for-hint="scroll-snap-margin-block">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-block">scroll-snap-margin-block<a class="self-link" href="#propdef-scroll-snap-margin-block"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-inline">scroll-snap-margin-inline<a class="self-link" href="#propdef-scroll-snap-margin-inline"></a></dfn>
     <tr class="value">
      <th>Value:
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
     <tr>
      <th>Initial:
      <td>0
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th>Inherited:
      <td>no
     <tr>
      <th>Percentages:
      <td>n/a
      <th>Computed value:
      <td>as specified, with lengths made absolute
     <tr>
      <th>Animatable:
      <td>as length
   </table>
   <p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-block-start" id="ref-for-propdef-scroll-snap-margin-block-start-1">scroll-snap-margin-block-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-block-end" id="ref-for-propdef-scroll-snap-margin-block-end-1">scroll-snap-margin-block-end</a> and <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-inline-start" id="ref-for-propdef-scroll-snap-margin-inline-start-1">scroll-snap-margin-inline-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-inline-end" id="ref-for-propdef-scroll-snap-margin-inline-end-1">scroll-snap-margin-inline-end</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-10">scroll-snap-margin</a>, and specify
	the block-axis and inline-axis
	edges of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-22">scroll snap area</a>,
	respectively.
	If two values are specified, the first gives the start value
	and the second gives the end value.</p>
   <h2 class="heading settled" data-level="8" id="priv-sec"><span class="secno">8. </span><span class="content">Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2>
   <p>This specification does not expose any information whatsoever
that is not already exposed to the DOM directly;
it just makes scrolling slightly more functional.
There are no new privacy or security considerations.</p>
   <h2 class="heading settled" data-level="9" id="acknowledgements"><span class="secno">9. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
   <p>Many thanks to
	David Baron,
	Simon Fraser,
	Håkon Wium Lie,
	Edward O’Connor,
	François Remy,
	Majid Valpour,
	potentially some anonymous Microsoft engineers (?),
	and most especially Robert O’Callahan
	for their proposals and recommendations,
	which have been incorporated into this document.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-52448c84">
   <a class="self-link" href="#example-52448c84"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#valdef-scroll-snap-stop-always">always</a><span>, in §6.3</span>
   <li><a href="#axis-snapping">axis</a><span>, in §7.2</span>
   <li><a href="#axis-lock">axis-lock</a><span>, in §7.1</span>
   <li><a href="#axis-snapping">axis-snap</a><span>, in §7.2</span>
   <li><a href="#axis-snapping">axis-snapping</a><span>, in §7.2</span>
   <li><a href="#axis-value">axis value</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-type-block">block</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-type-both">both</a><span>, in §5.1</span>
   <li><a href="#captures-snap-positions">captures snap positions</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-align-center">center</a><span>, in §6.2</span>
   <li><a href="#directional-scroll">directional</a><span>, in §7.1</span>
   <li><a href="#directional-scroll">directional scroll</a><span>, in §7.1</span>
   <li><a href="#valdef-scroll-snap-align-end">end</a><span>, in §6.2</span>
   <li><a href="#explicit-scroll">explicit</a><span>, in §7.1</span>
   <li><a href="#explicit-scroll">explicit scroll</a><span>, in §7.1</span>
   <li><a href="#inertial-scroll">inertial</a><span>, in §7.1</span>
   <li><a href="#inertial-scroll">inertial scroll</a><span>, in §7.1</span>
   <li><a href="#valdef-scroll-snap-type-inline">inline</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-type-mandatory">mandatory</a><span>, in §5.1</span>
   <li><a href="#natural-end-point">natural end-point</a><span>, in §7.1</span>
   <li>
    none
    <ul>
     <li><a href="#valdef-scroll-snap-type-none">value for scroll-snap-type</a><span>, in §5.1</span>
     <li><a href="#valdef-scroll-snap-align-none">value for scroll-snap-align</a><span>, in §6.2</span>
    </ul>
   <li><a href="#valdef-scroll-snap-stop-normal">normal</a><span>, in §6.3</span>
   <li>
    point
    <ul>
     <li><a href="#valdef-scroll-snap-type-point">value for scroll-snap-type</a><span>, in §5.1</span>
     <li><a href="#point-snapping">definition of</a><span>, in §7.2</span>
    </ul>
   <li><a href="#point-snapping">point-snap</a><span>, in §7.2</span>
   <li><a href="#point-snapping">point-snapping</a><span>, in §7.2</span>
   <li><a href="#valdef-scroll-snap-type-proximity">proximity</a><span>, in §5.1</span>
   <li><a href="#propdef-scroll-padding-block-end">scroll-padding-block-end</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-align">scroll-snap-align</a><span>, in §6.2</span>
   <li><a href="#scroll-snap-area">scroll snap area</a><span>, in §6.1</span>
   <li><a href="#scroll-snap-container">scroll snap container</a><span>, in §5.1</span>
   <li><a href="#propdef-scroll-snap-margin">scroll-snap-margin</a><span>, in §6.1</span>
   <li><a href="#propdef-scroll-snap-margin-block">scroll-snap-margin-block</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-block-end">scroll-snap-margin-block-end</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-block-start">scroll-snap-margin-block-start</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-bottom">scroll-snap-margin-bottom</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-inline">scroll-snap-margin-inline</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-inline-end">scroll-snap-margin-inline-end</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-inline-start">scroll-snap-margin-inline-start</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-left">scroll-snap-margin-left</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-right">scroll-snap-margin-right</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-margin-top">scroll-snap-margin-top</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding">scroll-snap-padding</a><span>, in §5.2</span>
   <li><a href="#propdef-scroll-snap-padding-block">scroll-snap-padding-block</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-block-start">scroll-snap-padding-block-start</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-bottom">scroll-snap-padding-bottom</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-inline">scroll-snap-padding-inline</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-inline-end">scroll-snap-padding-inline-end</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-inline-start">scroll-snap-padding-inline-start</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-left">scroll-snap-padding-left</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-right">scroll-snap-padding-right</a><span>, in §Unnumbered section</span>
   <li><a href="#propdef-scroll-snap-padding-top">scroll-snap-padding-top</a><span>, in §Unnumbered section</span>
   <li><a href="#scroll-snapport">scroll snapport</a><span>, in §5.2</span>
   <li><a href="#scroll-snap-position">scroll snap position</a><span>, in §4</span>
   <li><a href="#propdef-scroll-snap-stop">scroll-snap-stop</a><span>, in §6.3</span>
   <li><a href="#propdef-scroll-snap-type">scroll-snap-type</a><span>, in §5.1</span>
   <li><a href="#snap">snap</a><span>, in §4</span>
   <li><a href="#scroll-snap-area">snap area</a><span>, in §6.1</span>
   <li><a href="#snap-behavior">snap behavior</a><span>, in §7.2</span>
   <li><a href="#scroll-snap-container">snap container</a><span>, in §5.1</span>
   <li><a href="#snap">snapped</a><span>, in §4</span>
   <li><a href="#snap">snapping</a><span>, in §4</span>
   <li><a href="#snap-behavior">snapping behavior</a><span>, in §7.2</span>
   <li><a href="#scroll-snapport">snapport</a><span>, in §5.2</span>
   <li><a href="#scroll-snap-position">snap position</a><span>, in §4</span>
   <li><a href="#valdef-scroll-snap-align-start">start</a><span>, in §6.2</span>
   <li><a href="#strictness-value">strictness value</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-type-x">x</a><span>, in §5.1</span>
   <li><a href="#valdef-scroll-snap-type-y">y</a><span>, in §5.1</span>
  </ul>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-align-3]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-align-3/#propdef-align-self">align-self</a>
     <li><a href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>
     <li><a href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a>
     <li><a href="https://drafts.csswg.org/css-align-3/#propdef-justify-self">justify-self</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-backgrounds-3]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-backgrounds-3/#position">&lt;position></a>
     <li><a href="https://drafts.csswg.org/css-backgrounds-3/#border-image-outset">border-image-outset</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-cascade-4]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-cascade-4/#longhand">longhand</a>
     <li><a href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand</a>
     <li><a href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand property</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-display-3]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-display-3/#block">block</a>
     <li><a href="https://drafts.csswg.org/css-display-3/#containing-block-chain">containing block chain</a>
     <li><a href="https://drafts.csswg.org/css-display-3/#inline">inline</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-overflow-3/#scroll-container">scroll container</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-4]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-auto">auto</a>
     <li><a href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow">overflow</a>
     <li><a href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-scroll">scroll</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-values-3/#length-value">&lt;length></a>
     <li><a href="https://drafts.csswg.org/css-values-3/#percentage-value">&lt;percentage></a>
     <li><a href="https://drafts.csswg.org/css-values-3/#mult-num-range">{a,b}</a>
     <li><a href="https://drafts.csswg.org/css-values-3/#comb-one">|</a>
     <li><a href="https://drafts.csswg.org/css-values-3/#comb-any">||</a>
    </ul>
   <li>
    <a data-link-type="biblio">[css-writing-modes-3]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css-writing-modes-3/#block-axis">block axis</a>
     <li><a href="https://drafts.csswg.org/css-writing-modes-3/#inline-axis">inline axis</a>
     <li><a href="https://drafts.csswg.org/css-writing-modes-3/#writing-mode">writing mode</a>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS2]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/css2/box.html#propdef-margin">margin</a>
     <li><a href="https://drafts.csswg.org/css2/box.html#propdef-padding">padding</a>
    </ul>
   <li>
    <a data-link-type="biblio">[cssom-view-1]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/cssom-view-1/#dom-window-scrollby">scrollBy()</a>
     <li><a href="https://drafts.csswg.org/cssom-view-1/#dom-window-scrollto">scrollTo()</a>
    </ul>
   <li>
    <a data-link-type="biblio">[selectors-4]</a> defines the following terms:
    <ul>
     <li><a href="https://drafts.csswg.org/selectors-4/#target-pseudo">:target</a>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-align-3">[CSS-ALIGN-3]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-align/">CSS Box Alignment Module Level 3</a>. 14 June 2016. WD. URL: <a href="https://drafts.csswg.org/css-align/">https://drafts.csswg.org/css-align/</a>
   <dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3]
   <dd>CSS Backgrounds and Borders Module Level 3 URL: <a href="https://drafts.csswg.org/css-backgrounds-3/">https://drafts.csswg.org/css-backgrounds-3/</a>
   <dt id="biblio-css-cascade-4">[CSS-CASCADE-4]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="http://dev.w3.org/csswg/css-cascade/">CSS Cascading and Inheritance Level 4</a>. 14 January 2016. CR. URL: <a href="http://dev.w3.org/csswg/css-cascade/">http://dev.w3.org/csswg/css-cascade/</a>
   <dt id="biblio-css-display-3">[CSS-DISPLAY-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="http://dev.w3.org/csswg/css-display/">CSS Display Module Level 3</a>. 15 October 2015. WD. URL: <a href="http://dev.w3.org/csswg/css-display/">http://dev.w3.org/csswg/css-display/</a>
   <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3]
   <dd>David Baron; Florian Rivoal. <a href="http://drafts.csswg.org/css-overflow/">CSS Overflow Module Level 3</a>. 31 May 2016. WD. URL: <a href="http://drafts.csswg.org/css-overflow/">http://drafts.csswg.org/css-overflow/</a>
   <dt id="biblio-css-overflow-4">[CSS-OVERFLOW-4]
   <dd>CSS Overflow Module Level 4 URL: <a href="https://drafts.csswg.org/css-overflow-4/">https://drafts.csswg.org/css-overflow-4/</a>
   <dt id="biblio-css-values">[CSS-VALUES]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="http://dev.w3.org/csswg/css-values/">CSS Values and Units Module Level 3</a>. 11 June 2015. CR. URL: <a href="http://dev.w3.org/csswg/css-values/">http://dev.w3.org/csswg/css-values/</a>
   <dt id="biblio-css-writing-modes-3">[CSS-WRITING-MODES-3]
   <dd>Elika Etemad; Koji Ishii. <a href="http://dev.w3.org/csswg/css-writing-modes-3/">CSS Writing Modes Level 3</a>. 15 December 2015. CR. URL: <a href="http://dev.w3.org/csswg/css-writing-modes-3/">http://dev.w3.org/csswg/css-writing-modes-3/</a>
   <dt id="biblio-css2">[CSS2]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2">https://www.w3.org/TR/CSS2</a>
   <dt id="biblio-cssom-view-1">[CSSOM-VIEW-1]
   <dd>Simon Pieters. <a href="https://drafts.csswg.org/cssom-view/">CSSOM View Module</a>. 17 March 2016. WD. URL: <a href="https://drafts.csswg.org/cssom-view/">https://drafts.csswg.org/cssom-view/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-selectors-4">[SELECTORS-4]
   <dd>Selectors Level 4 URL: <a href="https://drafts.csswg.org/selectors-4/">https://drafts.csswg.org/selectors-4/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Media
      <th scope="col">Animatable
      <th scope="col">Computed value
      <th scope="col">Percentage
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-type">scroll-snap-type</a>
      <td>none | [ proximity | mandatory ] || [ x | y | block | inline | both | point ]
      <td>none
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>no
      <td>as specified
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding">scroll-snap-padding</a>
      <td>[ &lt;length> | &lt;percentage> ]{1,4}
      <td>0
      <td>scroll containers
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin">scroll-snap-margin</a>
      <td>&lt;length>{1,4}
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-align">scroll-snap-align</a>
      <td>[ none | start | end | center ]{1,2}
      <td>none
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>no
      <td>two keywords
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-stop">scroll-snap-stop</a>
      <td>normal | always
      <td>normal
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>no
      <td>as specified
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-top">scroll-snap-padding-top</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>n/a
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>relative to the corresponding dimension of the scroll container’s scrollport
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-right">scroll-snap-padding-right</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>n/a
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>relative to the corresponding dimension of the scroll container’s scrollport
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-bottom">scroll-snap-padding-bottom</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>n/a
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>relative to the corresponding dimension of the scroll container’s scrollport
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-left">scroll-snap-padding-left</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>n/a
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>relative to the corresponding dimension of the scroll container’s scrollport
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-inline-start">scroll-snap-padding-inline-start</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-block-start">scroll-snap-padding-block-start</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-inline-end">scroll-snap-padding-inline-end</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-padding-block-end">scroll-padding-block-end</a>
      <td>&lt;length> | &lt;percentage>
      <td>0
      <td>scroll containers
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-block">scroll-snap-padding-block</a>
      <td>[ &lt;length> | &lt;percentage> ]{1,2}
      <td>0
      <td>all elements
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding-inline">scroll-snap-padding-inline</a>
      <td>[ &lt;length> | &lt;percentage> ]{1,2}
      <td>0
      <td>all elements
      <td>no
      <td>relative to the corresponding dimension of the scroll container’s scrollport
      <td>interactive
      <td>as length, percentage, or calc
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-top">scroll-snap-margin-top</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-right">scroll-snap-margin-right</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-bottom">scroll-snap-margin-bottom</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-left">scroll-snap-margin-left</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-block-start">scroll-snap-margin-block-start</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-inline-start">scroll-snap-margin-inline-start</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-block-end">scroll-snap-margin-block-end</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-inline-end">scroll-snap-margin-inline-end</a>
      <td>&lt;length>
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-block">scroll-snap-margin-block</a>
      <td>&lt;length>{1,2}
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin-inline">scroll-snap-margin-inline</a>
      <td>&lt;length>{1,2}
      <td>0
      <td>all elements
      <td>no
      <td>n/a
      <td>interactive
      <td>as length
      <td>as specified, with lengths made absolute
      <td>
   </table>
  </div>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> <a href="https://lists.w3.org/Archives/Public/www-style/2015Nov/0328.html">We’re considering splitting this into subproperties.</a> Current proposed names are <span class="css">scroll-snap</span> for the current grammar, <span class="css">scroll-snap-affinity</span> for the proximity/mandatory distinction,
	and <span class="css">scroll-snap-axis</span> for the x/y/etc distinction.<a href="#issue-cdf7fb7c"> ↵ </a></div>
   <div class="issue"> Is this the correct writing mode to compute against?
	Or should it be the scroll container’s writing mode?<a href="#issue-eb80fe83"> ↵ </a></div>
   <div class="issue"> This feature is planned to be removed in the next publication
	in order to reduce the feature-set of Level 1.
	It is included here for future reference in defining Level 2.<a href="#issue-323279de"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="scroll-snap-position">
   <b><a href="#scroll-snap-position">#scroll-snap-position</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-snap-position-1">4. Scroll Snapping Model</a> <a href="#ref-for-scroll-snap-position-2">(2)</a> <a href="#ref-for-scroll-snap-position-3">(3)</a> <a href="#ref-for-scroll-snap-position-4">(4)</a> <a href="#ref-for-scroll-snap-position-5">(5)</a> <a href="#ref-for-scroll-snap-position-6">(6)</a> <a href="#ref-for-scroll-snap-position-7">(7)</a>
    <li><a href="#ref-for-scroll-snap-position-8">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-scroll-snap-position-9">(2)</a> <a href="#ref-for-scroll-snap-position-10">(3)</a> <a href="#ref-for-scroll-snap-position-11">(4)</a> <a href="#ref-for-scroll-snap-position-12">(5)</a> <a href="#ref-for-scroll-snap-position-13">(6)</a> <a href="#ref-for-scroll-snap-position-14">(7)</a> <a href="#ref-for-scroll-snap-position-15">(8)</a> <a href="#ref-for-scroll-snap-position-16">(9)</a> <a href="#ref-for-scroll-snap-position-17">(10)</a> <a href="#ref-for-scroll-snap-position-18">(11)</a> <a href="#ref-for-scroll-snap-position-19">(12)</a> <a href="#ref-for-scroll-snap-position-20">(13)</a> <a href="#ref-for-scroll-snap-position-21">(14)</a> <a href="#ref-for-scroll-snap-position-22">(15)</a> <a href="#ref-for-scroll-snap-position-23">(16)</a> <a href="#ref-for-scroll-snap-position-24">(17)</a> <a href="#ref-for-scroll-snap-position-25">(18)</a> <a href="#ref-for-scroll-snap-position-26">(19)</a>
    <li><a href="#ref-for-scroll-snap-position-27">5.2. Scroll Snapport: the scroll-snap-padding property</a>
    <li><a href="#ref-for-scroll-snap-position-28">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snap-position-29">(2)</a> <a href="#ref-for-scroll-snap-position-30">(3)</a> <a href="#ref-for-scroll-snap-position-31">(4)</a> <a href="#ref-for-scroll-snap-position-32">(5)</a> <a href="#ref-for-scroll-snap-position-33">(6)</a> <a href="#ref-for-scroll-snap-position-34">(7)</a>
    <li><a href="#ref-for-scroll-snap-position-35">6.2.1. 
Scoping Valid Snap Positions to Visible Boxes</a> <a href="#ref-for-scroll-snap-position-36">(2)</a>
    <li><a href="#ref-for-scroll-snap-position-37">6.2.2. 
Snapping Boxes that Overflow the Scrollport</a> <a href="#ref-for-scroll-snap-position-38">(2)</a> <a href="#ref-for-scroll-snap-position-39">(3)</a>
    <li><a href="#ref-for-scroll-snap-position-40">6.2.3. 
Unreachable Snap Areas</a> <a href="#ref-for-scroll-snap-position-41">(2)</a> <a href="#ref-for-scroll-snap-position-42">(3)</a>
    <li><a href="#ref-for-scroll-snap-position-43">6.3. Scroll Snap Limits: the scroll-snap-stop property</a> <a href="#ref-for-scroll-snap-position-44">(2)</a> <a href="#ref-for-scroll-snap-position-45">(3)</a> <a href="#ref-for-scroll-snap-position-46">(4)</a> <a href="#ref-for-scroll-snap-position-47">(5)</a> <a href="#ref-for-scroll-snap-position-48">(6)</a> <a href="#ref-for-scroll-snap-position-49">(7)</a> <a href="#ref-for-scroll-snap-position-50">(8)</a>
    <li><a href="#ref-for-scroll-snap-position-51">7. Snapping Mechanics</a>
    <li><a href="#ref-for-scroll-snap-position-52">7.2. Axis vs Point-Snapping</a> <a href="#ref-for-scroll-snap-position-53">(2)</a> <a href="#ref-for-scroll-snap-position-54">(3)</a> <a href="#ref-for-scroll-snap-position-55">(4)</a>
    <li><a href="#ref-for-scroll-snap-position-56">7.3. Choosing Snap Positions</a> <a href="#ref-for-scroll-snap-position-57">(2)</a> <a href="#ref-for-scroll-snap-position-58">(3)</a> <a href="#ref-for-scroll-snap-position-59">(4)</a> <a href="#ref-for-scroll-snap-position-60">(5)</a> <a href="#ref-for-scroll-snap-position-61">(6)</a> <a href="#ref-for-scroll-snap-position-62">(7)</a> <a href="#ref-for-scroll-snap-position-63">(8)</a> <a href="#ref-for-scroll-snap-position-64">(9)</a> <a href="#ref-for-scroll-snap-position-65">(10)</a> <a href="#ref-for-scroll-snap-position-66">(11)</a> <a href="#ref-for-scroll-snap-position-67">(12)</a> <a href="#ref-for-scroll-snap-position-68">(13)</a> <a href="#ref-for-scroll-snap-position-69">(14)</a> <a href="#ref-for-scroll-snap-position-70">(15)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="snap">
   <b><a href="#snap">#snap</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-snap-1">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-snap-2">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-snap-3">(2)</a> <a href="#ref-for-snap-4">(3)</a> <a href="#ref-for-snap-5">(4)</a> <a href="#ref-for-snap-6">(5)</a> <a href="#ref-for-snap-7">(6)</a> <a href="#ref-for-snap-8">(7)</a> <a href="#ref-for-snap-9">(8)</a> <a href="#ref-for-snap-10">(9)</a> <a href="#ref-for-snap-11">(10)</a>
    <li><a href="#ref-for-snap-12">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-type">
   <b><a href="#propdef-scroll-snap-type">#propdef-scroll-snap-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-type-1">3. Overview of Change</a> <a href="#ref-for-propdef-scroll-snap-type-2">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-type-3">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-propdef-scroll-snap-type-4">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-propdef-scroll-snap-type-5">(2)</a> <a href="#ref-for-propdef-scroll-snap-type-6">(3)</a> <a href="#ref-for-propdef-scroll-snap-type-7">(4)</a>
    <li><a href="#ref-for-propdef-scroll-snap-type-8">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scroll-snap-type-none">
   <b><a href="#valdef-scroll-snap-type-none">#valdef-scroll-snap-type-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scroll-snap-type-none-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-valdef-scroll-snap-type-none-2">(2)</a> <a href="#ref-for-valdef-scroll-snap-type-none-3">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scroll-snap-type-proximity">
   <b><a href="#valdef-scroll-snap-type-proximity">#valdef-scroll-snap-type-proximity</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scroll-snap-type-proximity-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-valdef-scroll-snap-type-proximity-2">(2)</a>
    <li><a href="#ref-for-valdef-scroll-snap-type-proximity-3">7.2. Axis vs Point-Snapping</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scroll-snap-type-mandatory">
   <b><a href="#valdef-scroll-snap-type-mandatory">#valdef-scroll-snap-type-mandatory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scroll-snap-type-mandatory-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a>
    <li><a href="#ref-for-valdef-scroll-snap-type-mandatory-2">7.2. Axis vs Point-Snapping</a>
    <li><a href="#ref-for-valdef-scroll-snap-type-mandatory-3">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="captures-snap-positions">
   <b><a href="#captures-snap-positions">#captures-snap-positions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-captures-snap-positions-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="scroll-snap-container">
   <b><a href="#scroll-snap-container">#scroll-snap-container</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-snap-container-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-scroll-snap-container-2">(2)</a>
    <li><a href="#ref-for-scroll-snap-container-3">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-padding">
   <b><a href="#propdef-scroll-snap-padding">#propdef-scroll-snap-padding</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-padding-1">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-propdef-scroll-snap-padding-2">5.2. Scroll Snapport: the scroll-snap-padding property</a> <a href="#ref-for-propdef-scroll-snap-padding-3">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-padding-4">Physical Longhands for scroll-snap-padding</a> <a href="#ref-for-propdef-scroll-snap-padding-5">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-padding-6">Flow-relative Longhands for scroll-snap-padding</a> <a href="#ref-for-propdef-scroll-snap-padding-7">(2)</a> <a href="#ref-for-propdef-scroll-snap-padding-8">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="scroll-snapport">
   <b><a href="#scroll-snapport">#scroll-snapport</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-snapport-1">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-scroll-snapport-2">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snapport-3">(2)</a> <a href="#ref-for-scroll-snapport-4">(3)</a> <a href="#ref-for-scroll-snapport-5">(4)</a> <a href="#ref-for-scroll-snapport-6">(5)</a> <a href="#ref-for-scroll-snapport-7">(6)</a> <a href="#ref-for-scroll-snapport-8">(7)</a>
    <li><a href="#ref-for-scroll-snapport-9">6.2.1. 
Scoping Valid Snap Positions to Visible Boxes</a> <a href="#ref-for-scroll-snapport-10">(2)</a> <a href="#ref-for-scroll-snapport-11">(3)</a> <a href="#ref-for-scroll-snapport-12">(4)</a>
    <li><a href="#ref-for-scroll-snapport-13">6.2.2. 
Snapping Boxes that Overflow the Scrollport</a> <a href="#ref-for-scroll-snapport-14">(2)</a> <a href="#ref-for-scroll-snapport-15">(3)</a> <a href="#ref-for-scroll-snapport-16">(4)</a> <a href="#ref-for-scroll-snapport-17">(5)</a>
    <li><a href="#ref-for-scroll-snapport-18">7.3. Choosing Snap Positions</a> <a href="#ref-for-scroll-snapport-19">(2)</a>
    <li><a href="#ref-for-scroll-snapport-20">Physical Longhands for scroll-snap-padding</a>
    <li><a href="#ref-for-scroll-snapport-21">Flow-relative Longhands for scroll-snap-padding</a> <a href="#ref-for-scroll-snapport-22">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-margin">
   <b><a href="#propdef-scroll-snap-margin">#propdef-scroll-snap-margin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-margin-1">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-propdef-scroll-snap-margin-2">6.1. Scroll Snapping Margin: the scroll-snap-margin property</a> <a href="#ref-for-propdef-scroll-snap-margin-3">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-margin-4">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-propdef-scroll-snap-margin-5">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-margin-6">Physical Longhands for scroll-snap-margin</a> <a href="#ref-for-propdef-scroll-snap-margin-7">(2)</a>
    <li><a href="#ref-for-propdef-scroll-snap-margin-8">Flow-relative Longhands for scroll-snap-margin</a> <a href="#ref-for-propdef-scroll-snap-margin-9">(2)</a> <a href="#ref-for-propdef-scroll-snap-margin-10">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="scroll-snap-area">
   <b><a href="#scroll-snap-area">#scroll-snap-area</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-snap-area-1">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-scroll-snap-area-2">5.2. Scroll Snapport: the scroll-snap-padding property</a>
    <li><a href="#ref-for-scroll-snap-area-3">6.1. Scroll Snapping Margin: the scroll-snap-margin property</a> <a href="#ref-for-scroll-snap-area-4">(2)</a>
    <li><a href="#ref-for-scroll-snap-area-5">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snap-area-6">(2)</a> <a href="#ref-for-scroll-snap-area-7">(3)</a> <a href="#ref-for-scroll-snap-area-8">(4)</a> <a href="#ref-for-scroll-snap-area-9">(5)</a>
    <li><a href="#ref-for-scroll-snap-area-10">6.2.1. 
Scoping Valid Snap Positions to Visible Boxes</a> <a href="#ref-for-scroll-snap-area-11">(2)</a> <a href="#ref-for-scroll-snap-area-12">(3)</a>
    <li><a href="#ref-for-scroll-snap-area-13">6.2.2. 
Snapping Boxes that Overflow the Scrollport</a> <a href="#ref-for-scroll-snap-area-14">(2)</a> <a href="#ref-for-scroll-snap-area-15">(3)</a> <a href="#ref-for-scroll-snap-area-16">(4)</a> <a href="#ref-for-scroll-snap-area-17">(5)</a>
    <li><a href="#ref-for-scroll-snap-area-18">6.2.3. 
Unreachable Snap Areas</a>
    <li><a href="#ref-for-scroll-snap-area-19">7.3. Choosing Snap Positions</a>
    <li><a href="#ref-for-scroll-snap-area-20">Physical Longhands for scroll-snap-margin</a>
    <li><a href="#ref-for-scroll-snap-area-21">Flow-relative Longhands for scroll-snap-margin</a> <a href="#ref-for-scroll-snap-area-22">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-align">
   <b><a href="#propdef-scroll-snap-align">#propdef-scroll-snap-align</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-align-1">3. Overview of Change</a>
    <li><a href="#ref-for-propdef-scroll-snap-align-2">4. Scroll Snapping Model</a>
    <li><a href="#ref-for-propdef-scroll-snap-align-3">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-propdef-scroll-snap-align-4">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scroll-snap-align-none">
   <b><a href="#valdef-scroll-snap-align-none">#valdef-scroll-snap-align-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scroll-snap-align-none-1">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-stop">
   <b><a href="#propdef-scroll-snap-stop">#propdef-scroll-snap-stop</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-stop-1">6.3. Scroll Snap Limits: the scroll-snap-stop property</a> <a href="#ref-for-propdef-scroll-snap-stop-2">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="explicit-scroll">
   <b><a href="#explicit-scroll">#explicit-scroll</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-explicit-scroll-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a>
    <li><a href="#ref-for-explicit-scroll-2">7.1. Types of Scrolling Methods</a>
    <li><a href="#ref-for-explicit-scroll-3">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="inertial-scroll">
   <b><a href="#inertial-scroll">#inertial-scroll</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-inertial-scroll-1">6.3. Scroll Snap Limits: the scroll-snap-stop property</a> <a href="#ref-for-inertial-scroll-2">(2)</a> <a href="#ref-for-inertial-scroll-3">(3)</a> <a href="#ref-for-inertial-scroll-4">(4)</a> <a href="#ref-for-inertial-scroll-5">(5)</a>
    <li><a href="#ref-for-inertial-scroll-6">7.1. Types of Scrolling Methods</a> <a href="#ref-for-inertial-scroll-7">(2)</a>
    <li><a href="#ref-for-inertial-scroll-8">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="natural-end-point">
   <b><a href="#natural-end-point">#natural-end-point</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-natural-end-point-1">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="directional-scroll">
   <b><a href="#directional-scroll">#directional-scroll</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-directional-scroll-1">7.1. Types of Scrolling Methods</a>
    <li><a href="#ref-for-directional-scroll-2">7.3. Choosing Snap Positions</a> <a href="#ref-for-directional-scroll-3">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="axis-lock">
   <b><a href="#axis-lock">#axis-lock</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-axis-lock-1">7.1. Types of Scrolling Methods</a>
    <li><a href="#ref-for-axis-lock-2">7.3. Choosing Snap Positions</a> <a href="#ref-for-axis-lock-3">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="snap-behavior">
   <b><a href="#snap-behavior">#snap-behavior</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-snap-behavior-1">7.2. Axis vs Point-Snapping</a> <a href="#ref-for-snap-behavior-2">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="axis-snapping">
   <b><a href="#axis-snapping">#axis-snapping</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-axis-snapping-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-axis-snapping-2">(2)</a> <a href="#ref-for-axis-snapping-3">(3)</a> <a href="#ref-for-axis-snapping-4">(4)</a> <a href="#ref-for-axis-snapping-5">(5)</a> <a href="#ref-for-axis-snapping-6">(6)</a> <a href="#ref-for-axis-snapping-7">(7)</a>
    <li><a href="#ref-for-axis-snapping-8">7.2. Axis vs Point-Snapping</a> <a href="#ref-for-axis-snapping-9">(2)</a> <a href="#ref-for-axis-snapping-10">(3)</a>
    <li><a href="#ref-for-axis-snapping-11">7.3. Choosing Snap Positions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="point-snapping">
   <b><a href="#point-snapping">#point-snapping</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-point-snapping-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a>
    <li><a href="#ref-for-point-snapping-2">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a>
    <li><a href="#ref-for-point-snapping-3">7.2. Axis vs Point-Snapping</a>
    <li><a href="#ref-for-point-snapping-4">7.3. Choosing Snap Positions</a> <a href="#ref-for-point-snapping-5">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-padding-inline-start">
   <b><a href="#propdef-scroll-snap-padding-inline-start">#propdef-scroll-snap-padding-inline-start</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-padding-inline-start-1">Flow-relative Longhands for scroll-snap-padding</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-padding-block-start">
   <b><a href="#propdef-scroll-snap-padding-block-start">#propdef-scroll-snap-padding-block-start</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-padding-block-start-1">Flow-relative Longhands for scroll-snap-padding</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-padding-inline-end">
   <b><a href="#propdef-scroll-snap-padding-inline-end">#propdef-scroll-snap-padding-inline-end</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-padding-inline-end-1">Flow-relative Longhands for scroll-snap-padding</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-margin-block-start">
   <b><a href="#propdef-scroll-snap-margin-block-start">#propdef-scroll-snap-margin-block-start</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-margin-block-start-1">Flow-relative Longhands for scroll-snap-margin</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-margin-inline-start">
   <b><a href="#propdef-scroll-snap-margin-inline-start">#propdef-scroll-snap-margin-inline-start</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-margin-inline-start-1">Flow-relative Longhands for scroll-snap-margin</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-margin-block-end">
   <b><a href="#propdef-scroll-snap-margin-block-end">#propdef-scroll-snap-margin-block-end</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-margin-block-end-1">Flow-relative Longhands for scroll-snap-margin</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scroll-snap-margin-inline-end">
   <b><a href="#propdef-scroll-snap-margin-inline-end">#propdef-scroll-snap-margin-inline-end</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-snap-margin-inline-end-1">Flow-relative Longhands for scroll-snap-margin</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

        document.body.addEventListener("click", function(e) {
            var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
            // Find the dfn element or panel, if any, that was clicked on.
            var el = e.target;
            var target;
            var hitALink = false;
            while(el.parentElement) {
                if(el.tagName == "A") {
                    // Clicking on a link in a <dfn> shouldn't summon the panel
                    hitALink = true;
                }
                if(el.classList.contains("dfn-paneled")) {
                    target = "dfn";
                    break;
                }
                if(el.classList.contains("dfn-panel")) {
                    target = "dfn-panel";
                    break;
                }
                el = el.parentElement;
            }
            if(target != "dfn-panel") {
                // Turn off any currently "on" or "activated" panels.
                queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
                    el.classList.remove("on");
                    el.classList.remove("activated");
                });
            }
            if(target == "dfn" && !hitALink) {
                // open the panel
                var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
                if(dfnPanel) {
                    console.log(dfnPanel);
                    dfnPanel.classList.add("on");
                    var rect = el.getBoundingClientRect();
                    dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
                    dfnPanel.style.top = window.scrollY + rect.top + "px";
                    var panelRect = dfnPanel.getBoundingClientRect();
                    var panelWidth = panelRect.right - panelRect.left;
                    if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                        // Reposition, because the panel is overflowing
                        dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
                    }
                } else {
                    console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
                }
            } else if(target == "dfn-panel") {
                // Switch it to "activated" state, which pins it.
                el.classList.add("activated");
                el.style.left = null;
                el.style.top = null;
            }

        });
        </script>
